
/* File name	: speed.h
 * Project 		: BKIT MCR
 * Version 		: 1.0
 * Creation Date: 07/07/2010
 * Tabsize		: 4
 * Author  		: BKIT4U                   
 * Copyright	: (c) 2010 BKIT HARDWARE CLUB - www.bkit4u.com
 * License		: Free.
 * Comments		: 
 * 
 */

#ifndef	__SPEED_H__
#define __SPEED_H__

/*====================================*/
/* Constant setting           		  */
/*====================================*/
#define	LEFT_SPEED	OCR2
#define RIGHT_SPEED	OCR0

#define PWM_POUT	PORTB
#define PWM_PIN		PINB
#define PWM_DDR		DDRB
#define PWM_RIGHT	PB4
#define PWM_LEFT	PB7

#define DIR_POUT	PORTD
#define DIR_PIN		PIND
#define DIR_DDR		DDRD
#define DIR_LEFT	PD1
#define DIR_RIGHT	PD0

#define BACKWARD		0
#define FORWARD			1

#define MAX_SPEED		250
#define MIN_SPEED		10

/*====================================*/
/* Prototype declaration      		  */
/*====================================*/
void speed_init();

void set_left_dir(unsigned char _dir);
void set_right_dir(unsigned char _dir);

void speed(int _left_speed, int _right_speed);

#endif



/****************END FILE**************/

